<?php echo $this->view->menssagem; ?>
<div class="panel panel-default">

    <div class="panel-heading" style="text-align: center;font-weight: bold;">Consulta de Contas a pagar</div>

    <div class="panel-body">
        <form class="form-inline" method="post" action="/caixa/conta_lista">
            <div class="form-group">
                <input class="form-control" type="text" name="pesq" size="30" placeholder="Digite o nome do beneficiario"/>
            </div>
            <button class="btn btn-primary" type="submit" ><span class="glyphicon glyphicon-search"></span> Pesquisar</button>

        </form>
    </div>
</div>
<table class="table table-striped table-hover">
    <tr>
        <th>Documento</th>
        <th>Descrição</th>
        <th>Beneficiamento</th>
        <th>Valor</th>
        <th>Vencimento</th>
        <th>Ações</th>
    </tr>
    <?php
    foreach ($this->view->lista as $c) {
        echo '<tr>';
        echo '<td>';
        echo $c['numero_documento'];
        echo '</td>';
        echo '<td>';
        echo $c['descricao'];
        echo '</td>';
        echo '<td>';
        echo $c['beneficiario_nome'];
        echo '</td>';
        echo '<td>';
        echo "R$ " . \SON\UTIL\Converter::doubleParaString($c['valor']);
        echo '</td>';
        echo '<td>';
        echo \SON\UTIL\Converter::dataTimeParaString($c['vencimento']);
        echo '</td>';
        echo '<td>';
        echo '<ul class="nav navbar-nav">';
        echo '<li>';
        echo "<form  method='post' action='/caixa/conta_baixa'>";
        echo "<input  name='id' value='{$c['id']}' type='hidden'></input> ";
        echo "<button class=\"btn btn-default\" type=\"submit\" ><span class=\"glyphicon glyphicon-floppy-save\"></span> Baixar</button>";
        echo '</form>';
        echo '</li>';
        echo '<li>';
        echo "<form  method='post' action='/caixa/conta_excluir'>";
        echo "<input  name='id' value='{$c['id']}' type='hidden'></input> ";
        echo "<button class=\"btn btn-default\" type=\"submit\" ><span class=\"glyphicon glyphicon-floppy-remove\"></span> Excluir</button>";
        echo '</form>';
        echo '</li>';
        echo '<li>';
        echo "<form  method='post' action='/caixa/conta_ver'>";
        echo "<input  name='id' value='{$c['id']}' type='hidden'></input> ";
        echo "<button class=\"btn btn-default\" type=\"submit\" ><span class=\"glyphicon glyphicon-th-list\"></span> Ver</button>";
        echo '</form>';
        echo '</li>';
        echo '<li>';
        echo "<form  method='post' action='/caixa/conta'>";
        echo "<input  name='id' value='{$c['id']}' type='hidden'></input> ";
        echo "<button class=\"btn btn-default\" type=\"submit\" ><span class=\"glyphicon glyphicon-pencil\"></span> Editar</button>";
        echo '</form>';
        echo '</li>';
        echo '</ul>';
        echo '</td>';
        echo '</tr>';
    }
    ?>
</table>
